<!DOCTYPE html>
<#assign base=request.contextPath />
<html>
<head lang="zh-CN">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <title>后台管理-欢迎登录</title>
    <link rel="icon" href="${base}/static/favicon.png" mce_href="${base}/static/favicon.png" type="image/x-icon">
    <link rel="shortcut icon" href="${base}/static/favicon.png" mce_href="${base}/static/favicon.png" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="${base}/static/login/base.css" media="all"/>
    <link rel="stylesheet" type="text/css" href="${base}/static/login/common.css" source="widget"/>
    <link type="text/css" rel="stylesheet" href="${base}/static/login/login-form.css" source="widget"/>
    <link type="text/css" rel="stylesheet" href="${base}/static/login/login-banner.css" source="widget"/>
    <script type="text/javascript" src="${base}/static/login/jquery-1.6.4.js"></script>
    <script type="text/javascript" src="${base}/static/cryptojs-v3.1.2/components/core-min.js"></script>
    <script type="text/javascript" src="${base}/static/cryptojs-v3.1.2/rollups/hmac-md5.js"></script>
    <style type="text/css">
        .error-msg{color: red;float:right;}
        #logo{position:relative;width:338px;margin:10px 0 0;height:60px;line-height:54px;}
        #logo b{line-height:60px;right:-117px;}
        #logo a{color:#4D4D4D;font-size:25px;font-family:"Microsoft YaHei","微软雅黑";}
        #logo a:hover{text-decoration:none;}
    </style>
</head>
<body>
<!-- SDK 登录 -->
<div class="w">
    <div id="logo"><a href="#">${applicationName}</a><b></b></div>
</div>
<div id="content">
    <div class="login-wrap">
        <div class="w">
            <div class="login-form" style="top: 65px">
                <div class="login-box">
                    <div class="mt">
                        <h1>管理登录</h1>
                    </div>
                    <div class="mc" style="margin-top: 20px;">
                        <div class="form">
                            <form id="formlogin" method="post" action="${base}/admin/login">
                                <input type="hidden" id="random" value="${random!}"/>
                                <div class="item item-fore1">
                                    <label for="nloginname" class="login-label name-label"></label>
                                    <input id="nloginname" type="text" class="itxt" tabindex="1" autocomplete="off" placeholder="用户名" maxlength="20" value="system"/>
                                    <input type="hidden" name="loginName" id="loginName" value="" class="hide"/>
                                    <span class="clear-btn"></span>
                                </div>
                                <div id="entry" class="item item-fore2">
                                    <label class="login-label pwd-label" for="nloginpwd"></label>
                                    <label id="sloginpwd" style="display: none;"></label>
                                    <input type="password" id="nloginpwd" class="itxt itxt-error" tabindex="2" autocomplete="off" placeholder="密码" maxlength="20" value="123"/>
                                    <input type="hidden" name="loginPwd" id="loginPwd" value="" class="hide"/>
                                    <div id="err-msg" class="error-msg">${errorInfo!}</div>
                                </div>

                                <div class="item item-fore5">
                                    <div class="login-btn">
                                        <a href="javascript:;" class="btn-img btn-entry" id="loginsubmit" tabindex="6">登&nbsp;&nbsp;&nbsp;&nbsp;录</a>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="coagent" style="display: none">
                            <h5>其它账号登录：</h5>
                            <ul>
                                <li>
                                    <a href="javascript:void(0)">其它平台</a>
                                    <span class="line">|</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="login-banner"
             style="<#if loginPage.backgroundImage != ''>
                        background: url('${base}/attached/image/${loginPage.backgroundImage}')
                    <#elseif loginPage.backgroundImage == '' && loginPage.backgroundColor != ''>
                        background:none;background-color:${loginPage.backgroundColor}
                    </#if>">
            <div class="w">
                <div id="banner-bg" class="i-inner">
                </div>
            </div>
        </div>
    </div>
</div>

<div class="w">
    <div id="footer-2013">
        <div class="links">
            <a rel="nofollow" target="_blank" href="#">
                关于我们
            </a>
            |
            <a rel="nofollow" target="_blank" href="#">
                联系我们
            </a>
            |
            <a rel="nofollow" target="_blank" href="#">
                人才招聘
            </a>
            |
            <a rel="nofollow" target="_blank" href="#">
                广告服务
            </a>
            |
            <a target="_blank" href="#">
                友情链接
            </a>
        </div>
        <div class="copyright">
            Copyright&copy;2015-2016&nbsp;&nbsp;<a href="#">ehome</a>&nbsp;版权所有
        </div>
    </div>
</div>

<script type="text/javascript">
    (function () {
        $("#loginsubmit").bind("click", login);
        $("#nloginname").bind("keypress", function (event) {
            if (event.keyCode == "13") login();
        });
        $("#nloginpwd").bind("keypress", function (event) {
            if (event.keyCode == "13") login();
        });
    })();

    // 登录
    function login() {
        var random = $("#random").val();
        var loginname = $("#nloginname").val();
        var loginpwd = $("#nloginpwd").val();
        var cipherLoginPwd = CryptoJS.HmacMD5(loginpwd, random);
        $("#loginName").val(loginname);
        $("#loginPwd").val(cipherLoginPwd);

        $("#formlogin").submit();
    }
</script>
</body>
</html>